package com.zj.common.mq;

import javax.jms.Message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsOperations;
import org.springframework.stereotype.Service;

@Service
public class SsReciveMessage {
	@Autowired
	JmsOperations jmsOperations;

	public Message reciveFromCorrelationID(String jmsCorrelationID) {
		Message msg = jmsOperations.receiveSelected("SBFSY.EXT.ONLINE.IN",
				"JMSCorrelationID=" + "'" + jmsCorrelationID + "'");
		return msg;
	}
	
	public Message reciveFromCorrelationID() {
		Message msg = jmsOperations.receive("SBFSY.EXT.ONLINE.IN");
		return msg;
	}
	
	
	
	public Message reciveFromMessage(String jmsCorrelationID) {
		Message msg = jmsOperations.receiveSelected("SBFSY.EXT.ONLINE.IN",
				"JMSMessageId=" + "'" + jmsCorrelationID + "'");
		return msg;
	}
}
